#include<stdio.h>
#include<stdlib.h>
int main(){
    int i,n;
    int f=0,s=0,t=0;
    scanf("%d",&n);
    int *a=(int*)malloc(n*sizeof(int));
    int *b=(int*)malloc(n*sizeof(int));
    int *c=(int*)malloc(2*n*sizeof(int));
    scanf("\n");
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++){
        scanf("%d",&b[i]);
    }
    while(f<n&&s<n){
        if(a[f]<b[s]){
            c[t]=a[f];t++;f++;
        }else{
            c[t]=b[s];t++;s++;
        }
    }
    while(f<n){
        c[t++]=a[f++];
    }
    while(s<n){
        c[t++]=b[s++];
    }
    printf("%d",c[(t-1)/2]);
    free(a);free(b);free(c);
    return 0;
}